package com.eudon.design_pattern.behavioral.strategy;

/**
 * @author eudon
 * @description 使用示例
 * @date 2025/9/2
 * @email syd19970616@gmail.com
 * @address <a href="https://gitee.com/eudon">Gitee</a>
 */
public class Use {
    public static void main(String[] args) {
        before();
        after();

    }
    private static void before(){
        String type = "B";
        if ("B".equals(type)){
            //策略B处理订单
        }else if ("A".equals(type)){
            //策略A处理订单

        }else  if ("C".equals(type)){
            //策略C处理订单

        }else {
            //策略A处理订单

        }
    }
    private static void after(){
        String type = "B";
        Strategy strategy = StrategyFactory.getInstance(type);
        strategy.processOrder();
    }
}
